/**
 * AccountService.java
 * Copyright(C) 1949++ 中华人民共和国
 * 深圳市盛开互联网金融顾问有限公司.
 * All rights reserved.
 * E-mail:server@skjr.net
 * SKDate:2017-11-16 17:28:58
 */
package com.huamao.zh.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.huamao.zh.base.PageWrapper;
import com.huamao.zh.mapper.AccountMapper;
import com.huamao.zh.model.Account;
import com.huamao.zh.service.AccountService;

@Service
@Transactional
public class AccountServiceImpl implements AccountService {

	@Autowired
	private AccountMapper accountMapper;

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public Account add(Account account) throws Exception {
		accountMapper.add(account);
		return account;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public Account addSelective(Account account) throws Exception {
		accountMapper.addSelective(account);
		return account;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public int delete(Map<String, Object> map) {
		return accountMapper.delete(map);
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public int update(Account account) throws Exception {
		return accountMapper.update(account);
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public int updateSelective(Account account) throws Exception {
		return accountMapper.updateSelective(account);
	}

	public int addFenrun(Account account) throws Exception {
		return accountMapper.addFenrun(account);
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public Account get(Integer accountId) {
		Account account = accountMapper.get(accountId);
		return account;
	}

	/**
	 * 功能说明： Author：zhoukun SKDate:2017-11-23
	 */
	public Account getByUserId(int userId) {
		Account account = accountMapper.getByUserId(userId);
		return account;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public PageWrapper<Account> search(PageWrapper<Account> pageWrapper) {
		List<Account> accounts = accountMapper.search(pageWrapper);
		pageWrapper.setList(accounts);
		return pageWrapper;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public List<Account> queryList(Map<String, Object> map) {
		return accountMapper.queryList(map);
	}

	/**
	 * 功能说明：查询需要把积分转换华宝的列表 Author：Bourne SKDate:2017-11-17 09:28:58
	 */
	public List<Account> queryScoreList(Map<String, Object> map) {
		return accountMapper.queryScoreList(map);
	}

	public int scoreToKaiyuan(Account account) throws Exception {
		return accountMapper.scoreToKaiyuan(account);
	}

	@Override
	public Account getByShopId(Integer shopId) {
		Account account = accountMapper.getByShopId(shopId);
		return account;
	}

	@Override
	public int updateFreezeCash(Account account) {
		return accountMapper.updateFreezeCash(account);
	}

	@Override
	public int updateFormalCash(Account account) {
		return accountMapper.updateFormalCash(account);
	}

	@Override
	public int updateExchangeCash(Account account) {
		return accountMapper.updateExchangeCash(account);
	}

	@Override
	public int updateBonusScore(Account account) {
		return accountMapper.updateBonusScore(account);
	}

	@Override
	public int updateProbationScore(Account account) {
		return accountMapper.updateProbationScore(account);
	}

	@Override
	public int addAccountSystem(int payScore) {
		return accountMapper.addAccountSystem(payScore);
	}
}